package com.yonyou.cms.epc.mapper.shoppingCart;

import com.yonyou.cms.epc.client.entity.shoppingCart.ShoppingCartPO;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @description: 购物车mapper接口类
 * @author: chengbufang
 * @date: 2022-06-29 14:51
 */
public interface ShoppingCartMapper extends SuperMapper<ShoppingCartPO> {

    /**
     * 查询购物车列表
     * @param params
     * @return
     */
    List<ShoppingCartPO> getCartList(@Param("params") Map<String, Object> params);

    /**
     * 购物车提交订单时查询相关信息
     * @param params
     * @return
     */
    List<Map<String, Object>> reportOrder(@Param("params") Map<String, Object> params);

    /**
     * 加入购物车
     * @param shoppingCartPo
     */
    void pushToCart(@Param("params") ShoppingCartPO shoppingCartPo);

    /**
     * 删除购物车
     * @param ids
     * @return
     */
    Integer deleteFromCart(@Param("ids") List<Long> ids);

    /**
     * 校验备件是否符合订单类型
     * @param params
     * @return
     */
    Integer checkOrderType(@Param("params") Map<String, Object> params);
}